package com.cxs.service.impl;

import com.cxs.mapper.StudentMapper;
import com.cxs.pojo.Student;
import com.cxs.service.StudentService;
import cxs.utils.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 * @Author:cxs
 * @Date:2021/10/3  11:48
 * @Version 1.0
 * @Motto:放下杂念,只为迎接明天更好的自己
 * */
@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> list() {
        return studentMapper.selectList();
    }

    @Override
    public Result add(Student student) {
        return studentMapper.insertSelective(student) > 0 ? Result.OK("添加成功") : Result.failare("添加失败");
    }
}
